package com.can.controller;

import com.can.entityDTO.JsonResult;
import com.can.entity.Authority;
import com.can.service.authority.IAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/authority")
public class AuthorityController {
    @Autowired
    private IAuthorityService authorityService;

    @PostMapping("/insert")
    @ResponseBody
    public JsonResult insert(@RequestBody Authority authority){
        int flag = authorityService.insert(authority);
        return JsonResult.createSuccess(flag);
    }
}
